/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package g.codesender;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author PiotrGl
 */
public class GCodeSender {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        File file = new File("D:/gcode.txt");
        StringBuilder contents = new StringBuilder();
        BufferedReader reader = null;
 
        try {
            reader = new BufferedReader(new FileReader(file));
            String text = null;
 
            // repeat until all lines is read
            while ((text = reader.readLine()) != null) {
                System.out.println(text);
                contents.append(text).append(System.getProperty("line.separator"));
            }
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                if (reader != null) {
                    reader.close();
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        //sprawdzanie poprawnosci maski
        //Maska mask = new Maska(0xF0, "ten");
        Maski maski = new Maski();
    
        maski.add(new Maska(0xF0,0xF0,"ten"));
        maski.add(new Maska(0x30,0x70,"tego"));
        
        System.out.println(maski.find(0xFF));
        System.out.println(maski.find(0x3F));
        
        // show file contents here
        //System.out.println(contents.toString());
    }
  
}
